package com.simple.proxy.dynamic.jdk;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class JDKProxy implements InvocationHandler {

    private Object target;

    public JDKProxy(Object target){
        this.target = target;
    }

    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("========JDK动态代理开始=======");
        Object result = method.invoke(target, args);
        System.out.println("========JDK动态代理结束=======");
        return result;
    }

}
